#ifndef ______WARD___BOXGROUP_H
#define ______WARD___BOXGROUP_H


#include "uielement.h"
#include "driver.h"
#include <list>



class boxGroup : public uielement
{

public:

	boxGroup(int x, int y, int boxStyle, int width, int n, int lim, int r = 3, int c = 3, int hpad=4, int ypad=4);

	void select();
	void left() {}
	void right() {}

	void draw() { drawEnabled(xpos,  ypos); }
	void drawAt(int x, int y) { drawEnabled(x,y); }
	float getData() { return 0; }

	bool clicked(int x, int y);
	void setData(float f) { data = f; }

	float getVal(int r, int c) { return buttonGroup[(r*cols)+c]->getData(); }
	float getVal(int i) { return buttonGroup[i]->getData(); }

	vector<float> getAll() 
	{ 
		vector <float> ret; 			
		std::vector<uielement*>::iterator i = buttonGroup.begin();
		for(; i != buttonGroup.end(); i++)
			ret.push_back((*i)->getData());
		return ret;
	}

	void onClick();


private:
	
	void drawEnabled(int x, int y);
	void drawDisabled();


	vector <uielement*> buttonGroup;
	list<int> selected;

	int curr;
	int rows, cols, size, hpadding, ypadding;
	unsigned int lim;
	int style;
	int width;

};




#endif